import os
def aa(path):
    list1=os.listdir(path)
    for i in list1:
        b=path+'\\'+i
        if os.path.isfile(b):
            if b.endswith('.py'):
              print(f'文件：{b}')
        else:
            aa(b)

aa(r'/')

import time
print(time.time())   #1970.1.1到现在时间所经历的秒数
# time.sleep(5)      #休眠时间
print('_____开机______')
print(time.localtime())  #获取本地时间
print(time.strftime('%Y/%m/%d',time.localtime()))

from datetime import datetime
print(datetime.now())
print(datetime(2000,1,3,1,3,4))

a = {
'name':'tom',
'age':23,
'height':178.98,
'sex':None,
'brother':['jack','tony'],
'爱好':{
'文学':['读书','写字','看电影','画画'],
'体育':['跑步','杠铃','游泳']
},
'是否是三好学生':False
}
import json
str=json.dumps(a)
print(str)
with open('a.txt', 'w', encoding='utf-8')as f:
    f.write(str)

with open('a.txt', 'r', encoding='utf-8')as d:
    str1=d.read()
a=json.loads(str1)
print(a)

b={
"name":'tom',
"age":23,
"喜欢的游戏以及角色":{"王者荣耀":'诸葛亮'},
"影视剧名称":['海贼王','火影']
}
str2=json.dumps(b)
with open('b.json', 'w', encoding='utf-8')as w:
    w.write(str2)
with open('b.json', 'r', encoding='utf-8')as w1:
    q=w1.read()
q1=json.loads(q)
print(type(q1))
print(q1)

